package com.wyh.order.controller;

import com.wyh.order.api.OpenFeignAPI;
import com.wyh.product.model.ProductInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignController {
    @Autowired
    OpenFeignAPI openFeignAPI1;

    @RequestMapping("o1")
    public String o1(String s){
        return openFeignAPI1.p1(s);
    }

    @RequestMapping("o2")
    public String o2(String s, Integer i){
        return openFeignAPI1.p2(s,i);
    }

    @RequestMapping("o3")
    public String o3(){
        ProductInfo productInfo = new ProductInfo();
        productInfo.setId(1);
        productInfo.setProductName("T恤");
        return openFeignAPI1.p3(productInfo);
    }

    @RequestMapping("o4")
    public String o4(){
        ProductInfo productInfo = new ProductInfo();
        productInfo.setId(1);
        productInfo.setProductName("T恤");
        return openFeignAPI1.p4(productInfo);
    }
}
